#ifndef __ZOOTA_COMMON_H__
#define __ZOOTA_COMMON_H__

#include <vector>
#include <string>

#include "qaholom.h"
#include "qahcontainer.h"

using namespace std;

/////////////////////////////////////////////////////////////////////
// Common Data Structure



struct RAWDATA
{
   unsigned long txDate;
   unsigned long txOpen;
   unsigned long txHigh;
   unsigned long txLow;
   unsigned long txClose;
   unsigned long txVolume;
};

struct TRADINGDAY
{
   unsigned int txDate;
   double txOpen;
   double txHigh;
   double txLow;
   double txClose;
   double txVolume;
};

struct D5AVGPRICE
{
   unsigned int txDate;
   double averagePrice;
};

typedef vector<TRADINGDAY> TRADINGDATA;

class TradingDataModel
{
protected:
   size_t       start;
   size_t       selected;
   double       maxPrice, minPrice;
   TRADINGDATA  tradingData;

public:  
   // nothing  
};


////////////////////////////////////////////////////////////////
// Global Vairables

extern TRADINGDATA         twStockData;
extern vector<D5AVGPRICE>  tw5DaysAveragePrice;
extern vector<D5AVGPRICE>  tw21DaysAveragePrice;

////////////////////////////////////////////////////////////////
// UI Elements of Charts and Diagrams


////////////////////////////////////////////////////////////////
// ZtTeklineChart Class Declaration

class ZoTeklineChart : public QahDrawArea
{
protected:
   double  maxPrice, minPrice;
   int     start;
   DTPOINT mpos;
   int     barCount;

public: 
   ZoTeklineChart(int w, int h) : QahDrawArea(w,h) 
   {
      start = 1;
      barCount = 0;
   }
   
public:
   gboolean onExpose(GdkEventExpose* event);  
   gboolean onButtonPressed(GdkEventButton* event); 
};


////////////////////////////////////////////////////////////////
// ZtMarketChart Class Declaration

// this chart displays target's history trading data
class ZoMarketChart : public QahDrawArea
{
protected:
   double  maxPrice, minPrice;
   int     start;
   DTPOINT mpos;
   int     barCount;

protected: 
public: // constructors and destructor
   ZoMarketChart(int w, int h) : QahDrawArea(w,h)
   { 
      start = 1; 
      barCount = 0;
   }

public: // signal handlers
   gboolean onButtonPressed(GdkEventButton* event);
   gboolean onMouseMoved(GdkEventButton *event);
   gboolean onKeyPressed(GdkEventKey  *event);
   gboolean onExpose(GdkEventExpose* event);   
};

// this chart displays daily detail trading data
class ZoDayDetailChart
{};

///////////////////////////////////////////////////////////////
// advanced composition chart

// this chart displays a snapshot about trading, also can 
// edit notes and memo.

class ZoMarketSnapshot; 



///////////////////////////////////////////////////////////////
// ZtXXXXSelector Class Declaration



#endif
